package com.jeasonzhao.report.model;

import com.jeasonzhao.model.AbstractModelItem;
import com.jeasonzhao.model.ModelField;
import com.jeasonzhao.report.codes.ConfigSrcTypes;

public abstract class BaseReportModelItem extends AbstractModelItem
{
	private static final long serialVersionUID = 1L;
	 @ModelField(names = "DistinguishID,guid")
    protected String m_strGuid = null;

    @ModelField(names = "configSrc,configurationSource")
    private String m_strConfigSrc = null;

    @ModelField(names = "configSrcType,configurationType")
    private ConfigSrcTypes m_configType = ConfigSrcTypes.Customize;

    public BaseReportModelItem()
    {

    }

    public BaseReportModelItem(BaseReportModelItem item)
    {
        this.copyFrom(item);
    }

    protected BaseReportModelItem copyFrom(BaseReportModelItem item)
    {
        if(null == item)
        {
            return this;
        }
        this.m_configType = item.m_configType;
        this.m_strGuid = item.m_strGuid;
        this.m_strConfigSrc = item.m_strConfigSrc;
        return this;
    }

    public String getGuid()
    {
        return m_strGuid;
    }

    public BaseReportModelItem setGuid(String srt)
    {
        m_strGuid = srt;
        return this;
    }

    public BaseReportModelItem setConfigSrc(String configSrc)
    {
        this.m_strConfigSrc = configSrc;
        return this;
    }

    public BaseReportModelItem setConfigType(ConfigSrcTypes configType)
    {
        this.m_configType = configType;
        return this;
    }

    public String getConfigSrc()
    {
        return m_strConfigSrc == null ? "" : m_strConfigSrc;
    }

    public ConfigSrcTypes getConfigType()
    {
        return m_configType == null ? ConfigSrcTypes.Customize : m_configType;
    }

}
